<template>
	<view v-if="loading" class="publish">
		<!--订单基本信息-->
		<view class="my-order-box">
			<template v-if="orderData.type === 'goods'">
				<ItemGoods :orderDetail="{}" :isOrder="true" :isRow="1" :item="orderData.release_info" :type="2"
					:identity_type="identity_type">
					<template v-slot:list>
						<view class="my-order-item">
							<view class="my-label">{{ $t('订单信息') }}</view>
							<view class="my-text" style="margin-left: auto;">
								<text v-if="user_type === 'release'">{{ $t('我发布的') }}</text>
								<text v-if="user_type === 'join'">{{ $t('我参与的') }}</text>
							</view>
						</view>
						<view class="my-order-item">
							<view class="my-label">{{ $t('订单号') }}：</view>
							<view class="my-text">{{ orderData.order_no }}</view>
						</view>
					</template>
					<template v-slot:btns>
						<view class="slotBtns">
							<view class="viewBtn" @click="goDetail">{{ $t('查看详情') }}</view>
							<view v-if="options_status === '2'" class="viewBtn" @click="goHzDetail">{{ $t('合作信息') }}>
							</view>
						</view>
					</template>
				</ItemGoods>
			</template>
			<template v-if="orderData.type === 'transport'">
				<ItemTransportList :orderDetail="{}" :isOrder="true" :isRow="1" :item="orderData.release_info"
					:type="2">
					<template v-slot:list>
						<view class="my-order-item">
							<view class="my-label">{{ $t('订单信息') }}</view>
							<view class="my-text" style="margin-left: auto;">
								<text v-if="user_type === 'release'">{{ $t('我发布的') }}</text>
								<text v-if="user_type === 'join'">{{ $t('我参与的') }}</text>
							</view>
						</view>
						<view class="my-order-item">
							<view class="my-label">{{ $t('订单号') }}：</view>
							<view class="my-text">{{ orderData.order_no }}</view>
						</view>
					</template>
					<template v-slot:btns>
						<view class="slotBtns">
							<view class="viewBtn" @click="goDetail">{{ $t('查看详情') }}</view>
							<view v-if="options_status === '2'" class="viewBtn" @click="goHzDetail">{{ $t('合作信息') }}>
							</view>
						</view>
					</template>
				</ItemTransportList>
			</template>
			<template v-if="orderData.type === 'crossborder'">
				<ItemFreightForwarder :orderDetail="{}" :isOrder="true" :isRow="1" :item="orderData.release_info"
					:type="2">
					<template v-slot:list>
						<view class="my-order-item">
							<view class="my-label">{{ $t('订单信息') }}</view>
							<view class="my-text" style="margin-left: auto;">
								<text v-if="user_type === 'release'">{{ $t('我发布的') }}</text>
								<text v-if="user_type === 'join'">{{ $t('我参与的') }}</text>
							</view>
						</view>
						<view class="my-order-item">
							<view class="my-label">{{ $t('订单号') }}：</view>
							<view class="my-text">{{ orderData.order_no }}</view>
						</view>
					</template>
					<template v-slot:btns>
						<view class="slotBtns">
							<view class="viewBtn" @click="goDetail">{{ $t('查看详情') }}</view>
							<view v-if="options_status === '2'" class="viewBtn" @click="goHzDetail">{{ $t('合作信息') }}>
							</view>
						</view>
					</template>
				</ItemFreightForwarder>
			</template>
			<template v-if="orderData.type === 'professional'">
				<ItemAgencyList :hidechat="true" :isOrder="true" :isRow="1" :item="orderData.release_info" :type="2">
					<template v-slot:list>
						<view class="my-order-item">
							<view class="my-label">{{ $t('订单信息') }}</view>
							<view class="my-text" style="margin-left: auto;">
								<text v-if="user_type === 'release'">{{ $t('我发布的') }}</text>
								<text v-if="user_type === 'join'">{{ $t('我参与的') }}</text>
							</view>
						</view>
						<view class="my-order-item">
							<view class="my-label">{{ $t('订单号') }}：</view>
							<view class="my-text">{{ orderData.order_no }}</view>
						</view>
					</template>
					<template v-slot:btns>
						<view class="slotBtns">
							<view class="viewBtn" @click="goDetail">{{ $t('查看详情') }}</view>
							<view v-if="options_status === '2'" class="viewBtn" @click="goHzDetail">{{ $t('合作信息') }}>
							</view>
						</view>
					</template>
				</ItemAgencyList>
			</template>

		</view>
		<view class="audit" v-if="orderData.check_status !== '2' && orderData.join_order_id !== 0">
			<view v-if="user_type === 'join_no'">{{ $t('订单还未达成合作') }}</view>
			<view v-else>{{ $t('您的订单正在等待后台审核，审核通过后，可达成合作') }}</view>
		</view>
		<!--参与方 - 该订单未达成合作时，可以修改参与信息-->
		<!-- <view v-if="user_type === 'join_no' && orderData.join_order_id === 0" class="form-box"> -->
		<view v-if="user_type === 'join_no' " class="form-box">
			<view class="form-title">{{ $t('我参与的信息') }}</view>
			<view class="form-item">
				<view class="item red">
					<view>{{ $t('当前价格排名') }}</view>
					<view>{{ changeTextByPm(orderJoinData[$t('item.price_ranking')]) }}</view>
				</view>
				<view class="item orange">
					<view>{{ $t('当前速度排名') }}</view>
					<view>{{ changeTextByPm(orderJoinData[$t('item.speed_ranking')]) }}</view>
				</view>
				<view class="item blue">
					<view>{{ $t('当前综合排名') }}</view>
					<view>{{ changeTextByPm(orderJoinData[$t('item.num_ranking')]) }}</view>
				</view>
			</view>


			<!--orderJoinData-修改参与信息-->
			<buildForm v-if="formLoading" :formItems="formItems" :value="formJoin" :isDetail2="isDetail2"
				@input="formInput" />


			<view>
				<u-button v-if="!isDetail" :custom-style="{
          width: '656rpx',
          height: '63rpx',
          background: 'linear-gradient(110deg, #DD2910 0%, #F79B29 100%)',
          borderRadius: '26rpx'
        }" hover-class="none" type="primary" @click="subForm">
					{{ $t('提交') }}
				</u-button>
			</view>
		</view>
		<view class="publish_cooperation" v-else>
			<view class="countdown"
				v-if="countdownTime > 0 && orderData.join_pay_status === '1' && orderData.status < 8">
				<template v-if="orderJoinData.is_stop_countdown === 0">
					<view>{{ $t('订单结束倒计时') }}：</view>
					<u-count-down :timestamp="countdownTime"></u-count-down>
				</template>
				<template v-else>
					<view>{{ $t('倒计时已暂停') }}</view>
				</template>
			</view>
			<!--发布方上传打款进度图片-->
			<view class="release-pay-img" v-if="user_type === 'release' && orderData.join_order_id !== 0">
				<view class="text">{{ $t('上传打款证明图片') }}：</view>
				<u-upload :upload-text="$t('选择图片')" @on-success="releasePayImgSuccess" :action="releasePayImgAction"
					:file-list="releasePayImgList" max-count="1" :deletable="releasePayImgDeletable"></u-upload>
				<view v-if="orderData.release_pay_status === '0'" class="viewBtn" @click="doSaveReleasePayImg">
					{{ $t('提交') }}
				</view>
				<view v-else class="viewBtn">{{ $t('已提交') }}</view>
			</view>
			<!--参与方确认对方打款进度-->
			<view class="release-pay-img" v-if="user_type === 'join' && orderData.release_pay_status === '1'">
				<view class="text">{{ $t('打款证明图片') }}：</view>
				<u-upload :upload-text="$t('选择图片')" :file-list="releasePayImgList" max-count="1"
					:deletable="false"></u-upload>
				<view v-if="orderData.join_pay_status === '0'" class="viewBtn" @click="doSaveJoinPayImg">
					{{ $t('确认') }}
				</view>
				<view v-else class="viewBtn">{{ $t('已确认') }}</view>
			</view>
			<!--发布方上传尾款进度图片-->
			<view class="release-pay-img" v-if="user_type === 'release' && orderData.join_order_id !== 0">
				<view class="text">{{ $t('上传尾款证明图片') }}：</view>
				<u-upload :upload-text="$t('选择图片')" @on-success="releasePayEndImgSuccess" :action="releasePayImgAction"
					:file-list="releasePayEndImgList" max-count="1" :deletable="releasePayEndImgDeletable"></u-upload>
				<view v-if="orderData.release_pay_end_status === '0'" class="viewBtn" @click="doSaveReleasePayEndImg">
					{{ $t('提交') }}
				</view>
				<view v-else class="viewBtn">{{ $t('已提交') }}</view>
			</view>
			<!--参与方确认对方尾款进度-->
			<view class="release-pay-img" v-if="user_type === 'join' && orderData.release_pay_end_status === '1'">
				<view class="text">{{ $t('尾款证明图片') }}：</view>
				<u-upload :upload-text="$t('选择图片')" :file-list="releasePayEndImgList" max-count="1"
					:deletable="false"></u-upload>
				<view v-if="orderData.join_pay_end_status === '0'" class="viewBtn" @click="doSaveJoinPayEndImg">
					{{ $t('确认') }}
				</view>
				<view v-else class="viewBtn">{{ $t('已确认') }}</view>
			</view>
			<!--合作信息-->
			<my-title v-if="status === '0' && joinListData.length > 0" title="合作信息"></my-title>


			<!-- 筛选 -->
			<view v-if="status == '0' && joinListData.length > 0" style="background: white;padding: 0 25rpx 0 25rpx">
				<u-dropdown active-color="#FF5F00">
					<u-dropdown-item v-model="value1" :options="options1" :title="$t('价格')"
						@change="change(value1, 'price')"></u-dropdown-item>
					<u-dropdown-item v-model="value2" :options="options2" :title="$t('速度')"
						@change="change(value2, 'speed')"></u-dropdown-item>
					<u-dropdown-item v-model="value3" :options="options3" :title="$t('综合排序')"
						@change="change(value3, 'ranking_score')"></u-dropdown-item>
				</u-dropdown>
			</view>

			<!-- 列表 -->
			<view style="background-color: #F7F7F7;padding-top: 30rpx;" v-if="status == '0'">
				<view class="bidding_news" v-for="(item, index) in dataes" :key="index" @click="cooperate1(index)">
					<view class="bidding_card">
						<view class="bidding_betwn">
							<!--头像-->
							<view class="bidding_user">
								<!-- <image :src="toImages(i.user.avatar)" class="bidding_user_image"></image> -->
								<u-avatar :size="100" :src="url + item.join_user.avatar"></u-avatar>
								<!-- <text class="bidding_user_text">
									{{ lang == 'zh' ? item.join_user.username : item.join_user.username_ru }}
								</text>
								<image :src="url + item.join_user.label[0].url"
									style="width: 60rpx;height: 50rpx;margin-left: 20rpx;">
								</image> -->
								<view class="bidding_user" style="flex-direction: column;align-items: flex-start;">
									<text class="bidding_user_text" style="padding-left: 0;">
										{{ lang == 'zh' ? item.join_user.username : item.join_user.username_ru }}
									</text>
									<view>
										<image v-if="item.join_user&&item.join_user.label&&item.join_user.label[0]"
											:src="url + item.join_user.label[0].url"
											style="width: 40rpx;height: 30rpx;vertical-align: middle;">
										</image>
										<text style="font-size: 20rpx;">{{$t('评分')}}{{ item.join_user.rating }}</text>
									</view>
								</view>
							</view>
						</view>
						<!--信息展示-->
						<view class="biddin_synopsis">
							<!-- <view class="bidding_synopsis_sel">
								<text class="text1">{{ $t('评分') }}：</text>
								<text>{{ item.join_user.rating }}</text>
							</view> -->
							<view class="bidding_synopsis_sel red font-weight">
								<text class="text1 red font-weight">{{ $t('综合排名') }}：</text>
								<text>{{ lang == 'zh' ? item.num_ranking : changeTextByPm(item.num_ranking_ru) }}</text>
							</view>
							<view class="bidding_synopsis_sel orange font-weight">
								<text class="text1 orange font-weight">{{ $t('价格排名') }}：</text>
								<text>{{ lang == 'zh' ? item.price_ranking : changeTextByPm(item.price_ranking_ru) }}</text>
							</view>
							<view class="bidding_synopsis_sel blue font-weight">
								<text class="text1 blue font-weight">{{ $t('速度排名') }}：</text>
								<text>{{ lang == 'zh' ? item.speed_ranking : changeTextByPm(item.speed_ranking_ru) }}</text>
							</view>
							<template v-if="item.type === 'goods'">
								<view class="bidding_synopsis_sel textLarge font-weight red">
									<!-- <text class="text1">{{ $t('提供产品') }}：</text> -->
									<text>{{ lang == 'zh' ? item.product : item.product_ru }}</text>
								</view>

								<view class="bidding_synopsis_sel line-height">
									<text class="text1">{{ $t('交货时间(天)') }}：</text>
									<text class="text1">{{ item.speed }}{{ $t("天") }}</text>
								</view>
								<view class="bidding_synopsis_sel line-height">
									<text class="text1">{{ $t('单价') }}：</text>
									<text class="text1 red u-font-32">
										{{ item.price }}{{ $t(item.price_unit) }}/{{orderData.release_info[$t("item.number_unit")]}}
									</text>
								</view>

								<view class="bidding_synopsis_sel line-height">
									<text class="text1">{{ $t('数量') }}：</text>
									<text class="text1">
										{{ item.num }}{{orderData.release_info[$t("item.number_unit")]}}
									</text>
								</view>

								<view class="bidding_synopsis_sel line-height" v-if="item.pay_margin!='否'">
									<text class="text1">{{ $t('是否缴纳保证金') }}：</text>
									<text class="text1" style="color: red;">
										{{$t(item.pay_margin)}}
									</text>
								</view>

								<view class="bidding_synopsis_sel line-height" v-if="item.pay_margin!='否'">
									<text class="text1">{{ $t('保证金金额') }}：</text>
									<text class="text1" style="color: red;">
										{{item.margin_amount}}<text class="black" style="color: red;">{{$t("元")}}</text>
									</text>
								</view>

								<view class="bidding_synopsis_sel line-height" v-if="item.send_time>0">
									<text class="text1">{{ $t('发货时间') }}：</text>
									<text class="text1">{{ time("S", item.send_time,"date") }}</text>
								</view>
							</template>
							<template v-else-if="item.type === 'crossborder'">
								<view class="bidding_synopsis_sel line-height">
									<text class="text1">{{ $t('运输方式') }}：</text>
									<!-- <text class="text1">{{ item.mode }}</text> -->
								</view>
								<view class="bidding_synopsis_sel">
									<TransportType :item="item" :showTitle="false"></TransportType>
								</view>
								<view class="bidding_synopsis_sel line-height">
									<text class="text1">{{ $t('发货口岸') }}：</text>
									<text class="text1">{{ item.port_city[$t('item.city.mergename')]}}</text>
								</view>
								<view class="bidding_synopsis_sel line-height" v-if="item.send_time>0">
									<text class="text1">{{ $t('接货时间') }}：</text>
									<text class="text1">{{ time("S", item.send_time,"date") }}</text>
								</view>
								<view class="bidding_synopsis_sel line-height">
									<text class="text1">{{ $t('费用总价') }}：</text>
									<text class="text1 red">{{ item.price }}{{ $t(item.price_unit) }}</text>
								</view>
								<view class="bidding_synopsis_sel">
									<text class="text1">{{ $t('速度') }}：</text>
									<text>{{ item.speed }}{{$t("天")}}</text>
								</view>

								<view class="bidding_synopsis_sel line-height" v-if="item.pay_margin!='否'">
									<text class="text1">{{ $t('是否缴纳保证金') }}：</text>
									<text class="text1" style="color: red;">
										{{$t(item.pay_margin)}}
									</text>
								</view>

								<view class="bidding_synopsis_sel line-height" v-if="item.pay_margin!='否'">
									<text class="text1">{{ $t('保证金金额') }}：</text>
									<text class="text1" style="color: red;">
										{{item.margin_amount}}<text class="black" style="color: red;">{{$t("元")}}</text>
									</text>
								</view>

								<!-- <view class="bidding_synopsis_sel">
									<text class="text1">{{ $t('发货口岸') }}：</text>
									<text>{{ item.port_city[$t('item.city.mergename')]}}</text>
								</view>
								<view class="bidding_synopsis_sel line-height">
									<text class="text1">{{ $t('运输方式') }}：</text>
									<text>{{ item.mode }}</text>
								</view> -->
							</template>
							<template v-else-if="item.type === 'professional'">
								<!-- 	<view class="bidding_synopsis_sel">
									<text class="text1">{{ $t('服务内容') }}：</text>
									<text>{{ lang === 'zh' ? item.product : item.product_ru }}</text>
								</view> -->
								<view class="bidding_synopsis_sel textLarge font-weight red"
									style="min-height: 150rpx;">
									<text>{{ lang === 'zh' ? item.product : item.product_ru }}</text>
								</view>
								<view class="bidding_synopsis_sel line-height">
									<text class="text1">{{ $t('服务报价') }}：</text>
									<text class="text1 red">{{ item.price }}{{ $t(item.price_unit) }}</text>
								</view>
								<view class="bidding_synopsis_sel line-height">
									<text class="text1">{{ $t('服务时长') }}：</text>
									<text class="text1">{{ item.speed }}{{ $t('天') }}</text>
								</view>

								<view class="bidding_synopsis_sel line-height" v-if="item.pay_margin!='否'">
									<text class="text1">{{ $t('是否缴纳保证金') }}：</text>
									<text class="text1" style="color: red;">
										{{$t(item.pay_margin)}}
									</text>
								</view>

								<view class="bidding_synopsis_sel line-height" v-if="item.pay_margin!='否'">
									<text class="text1">{{ $t('保证金金额') }}：</text>
									<text class="text1" style="color: red;">
										{{item.margin_amount}}<text class="black" style="color: red;">{{$t("元")}}</text>
									</text>
								</view>
							</template>
							<template v-else-if="item.type === 'transport'">
								<template v-if="item.release_info.release_type === '1'">
									<view class="bidding_synopsis_sel textLarge font-weight red">
										<text>
											{{ lang == 'zh' ? item.product : item.product_ru }}
											({{ item.num }}{{item[$t("item.number_unit")]}})
										</text>
									</view>
									<view class="bidding_synopsis_sel">
										<Tag :text="(item.product_volume || 0) + 'm³'" color="#2b7deb"></Tag>
										<Tag :text="(item.product_weight || 0) + 'kg'" color="#ef9b17"></Tag>
									</view>
									<view class="bidding_synopsis_sel line-height">
										<text class="text1">{{ $t('运费总价') }}：</text>
										<text
											class="text1 red u-font-32">{{ item.price }}{{ $t(item.price_unit) }}</text>
									</view>
									<view class="bidding_synopsis_sel line-height">
										<text class="text1">{{ $t('发货时间') }}：</text>
										<text class="text1">{{ time("S", item.send_time,"date") }}</text>
									</view>
									<view class="bidding_synopsis_sel line-height" v-if="item.pay_margin!='否'">
										<text class="text1">{{ $t('是否缴纳保证金') }}：</text>
										<text class="text1" style="color: red;">
											{{$t(item.pay_margin)}}
										</text>
									</view>

									<view class="bidding_synopsis_sel line-height" v-if="item.pay_margin!='否'">
										<text class="text1">{{ $t('保证金金额') }}：</text>
										<text class="text1" style="color: red;">
											{{item.margin_amount}}<text class="black"
												style="color: red;">{{$t("元")}}</text>
										</text>
									</view>
									<view class="bidding_synopsis_sel line-height">
										<view>
											<u-image style="margin-right: 10rpx;" :src="HTTP_IMG_UTL+'agencyIcon3.png'"
												width="40rpx" height="40rpx"></u-image>
										</view>
										<text class="text1"
											style="width: 420rpx;">{{ item.product_address[$t("item.city.mergename")] }}</text>
									</view>
									<view class="bidding_synopsis_sel line-height">
										<view>
											<u-image style="margin-right: 10rpx;"
												:src="HTTP_IMG_UTL+'transportIcon1.png'" width="40rpx"
												height="40rpx"></u-image>
										</view>
										<text class="text1"
											style="width: 420rpx;">{{ item.reach_address[$t("item.city.mergename")] || $t("暂无信息")}}</text>
									</view>
								</template>
								<template v-else-if="item.release_info.release_type === '2'">
									<view class="bidding_synopsis_sel textLarge font-weight red">
										<text>{{ lang === 'zh' ? item.car_category_id_text : item.car_category_id_text_ru }}</text>
									</view>
									<view class="bidding_synopsis_sel line-height">
										<text class="text1">{{ $t('运费总价') }}：</text>
										<text class="text1 red">{{ item.price }}{{ $t(item.price_unit) }}</text>
									</view>
									<view class="bidding_synopsis_sel">
										<Tag :text="(item.product_volume || 0) + 'm³'" color="#2b7deb"></Tag>
										<Tag :text="(item.product_weight || 0) + 'kg'" color="#ef9b17"></Tag>
									</view>
									<view class="bidding_synopsis_sel line-height">
										<text class="text1">{{ $t('接货时间') }}：</text>
										<text class="text1">{{ time("S", item.send_time,"date") }}</text>
									</view>

									<view class="bidding_synopsis_sel">
										<text class="text1">{{ $t('运输速度') }}：</text>
										<text class="text1">{{ item.speed }}{{$t("天")}}</text>
									</view>

									<view class="bidding_synopsis_sel line-height" v-if="item.pay_margin!='否'">
										<text class="text1">{{ $t('是否缴纳保证金') }}：</text>
										<text class="text1" style="color: red;">
											{{$t(item.pay_margin)}}
										</text>
									</view>

									<view class="bidding_synopsis_sel line-height" v-if="item.pay_margin!='否'">
										<text class="text1">{{ $t('保证金金额') }}：</text>
										<text class="text1" style="color: red;">
											{{item.margin_amount}}<text class="black"
												style="color: red;">{{$t("元")}}</text>
										</text>
									</view>

									<!-- <view class="bidding_synopsis_sel">
										<text class="text1">{{ $t('车型') }}：</text>
										<text>{{ lang === 'zh' ? item.car_category_id_text : item.car_category_id_text_ru }}</text>
									</view>
									<view class="bidding_synopsis_sel">
										<text class="text1">{{ $t('体积') }}：</text>
										<text>{{ item.product_volume }}m³</text>
									</view>
									<view class="bidding_synopsis_sel">
										<text class="text1">{{ $t('运费总价') }}：</text>
										<text>{{ item.price }}{{ $t(item.price_unit) }}</text>
									</view>
									<view class="bidding_synopsis_sel">
										<text class="text1">{{ $t('速度') }}：</text>
										<text>{{ item.speed }}{{$t("天")}}</text>
									</view> -->
								</template>
								<template v-else-if="item.release_info.release_type === '3'">
									<!--<view class="bidding_synopsis_sel">-->
									<!--  <text class="text1">{{ $t('提供产品') }}：</text>-->
									<!--  <text>{{ lang === 'zh' ? item.product : item.product_ru }}</text>-->
									<!--</view>-->
									<!-- 货源信息 -->
									<template v-if="item.release_info.human_type === '1'">
										<view class="bidding_synopsis_sel textLarge font-weight red"
											style="opacity: 0;">
											1
										</view>

										<view class="bidding_synopsis_sel line-height">
											<text class="text1">{{ $t('运费出价') }}：</text>
											<text class="text1 red">{{ item.price }}{{ $t(item.price_unit) }}/kg</text>
										</view>
										<view class="bidding_synopsis_sel line-height">
											<text class="text1">{{ $t('运输速度') }}：</text>
											<text class="text1">{{ item.speed }}{{$t("天")}}</text>
										</view>
										<view class="bidding_synopsis_sel line-height">
											<text class="text1">{{ $t('接货时间') }}：</text>
											<text class="text1">{{ time("S", item.send_time,"date") }}</text>
										</view>

										<view class="bidding_synopsis_sel line-height" v-if="item.pay_margin!='否'">
											<text class="text1">{{ $t('是否缴纳保证金') }}：</text>
											<text class="text1" style="color: red;">
												{{$t(item.pay_margin)}}
											</text>
										</view>

										<view class="bidding_synopsis_sel line-height" v-if="item.pay_margin!='否'">
											<text class="text1">{{ $t('保证金金额') }}：</text>
											<text class="text1" style="color: red;">
												{{item.margin_amount}}<text class="black"
													style="color: red;">{{$t("元")}}</text>
											</text>
										</view>

									</template>
									<!-- 小件快递 -->
									<template v-if="item.release_info.human_type === '2'">
										<view class="bidding_synopsis_sel textLarge font-weight red">
											{{ lang === 'zh' ? item.product : item.product_ru }}
											<!-- ({{item.num}}{{item[$t("item.number_unit")] || ''}}) -->
										</view>
										<view class="bidding_synopsis_sel line-height u-margin-bottom-10">
											<text class="text1">{{ $t('运费出价') }}：</text>
											<text class="text1 red">{{ item.price }}{{ $t(item.price_unit) }}/kg</text>
										</view>
										<view class="bidding_synopsis_sel u-margin-bottom-10 u-margin-top-10">
											<Tag :text="(item.product_volume || 0) + 'm³'" color="#2b7deb"></Tag>
											<Tag :text="(item.product_weight || 0) + 'kg'" color="#ef9b17"></Tag>
										</view>
										<!-- 	<view class="bidding_synopsis_sel">
											<text class="text1">{{ $t('货物名称') }}：</text>
											<text>{{ lang === 'zh' ? item.product : item.product_ru }}</text>
										</view> -->

										<view class="bidding_synopsis_sel line-height">
											<text class="text1">{{ $t('发货时间') }}：</text>
											<text class="text1">{{ time("S", item.send_time,"date") }}</text>
										</view>

										<view class="bidding_synopsis_sel line-height" v-if="item.pay_margin!='否'">
											<text class="text1">{{ $t('是否缴纳保证金') }}：</text>
											<text class="text1" style="color: red;">
												{{$t(item.pay_margin)}}
											</text>
										</view>

										<view class="bidding_synopsis_sel line-height" v-if="item.pay_margin!='否'">
											<text class="text1">{{ $t('保证金金额') }}：</text>
											<text class="text1" style="color: red;">
												{{item.margin_amount}}<text class="black"
													style="color: red;">{{$t("元")}}</text>
											</text>
										</view>
									</template>

								</template>
							</template>
						</view>
						<!--商品图片展示区(控制是否显示）-->
						<view class="bidding_image">
							<image :src="url + item.logo" :border-radius="20" v-if="item.logo"></image>

							<image :src="url + item.images[0]" :border-radius="20" v-else></image>

							<!-- :src="url + item.images[0]" -->
						</view>
						<!-- 选择合作，即时沟通 -->
						<view
							style="display: flex;justify-content: space-evenly;padding-bottom: 30rpx;border-top: 2rpx solid #f1f1f1;margin-top: 10rpx;">
							<view class="my-btn communication panel" @click.stop="communicates1(index)">
								{{ ($t('即时沟通')) }}
							</view>
							<view class="my-btn cooperation panel" @click.stop="cooperate1(index)">
								{{ $t('选择合作') }}
							</view>
						</view>

					</view>
				</view>
			</view>


			<!--进度显示-->
			<view
				v-if="['2', '6', '8', '9', '10'].indexOf(status) !== -1 && orderData.check_status === '2' && orderData.join_pay_status === '1'">
				<orderStep :list="stepList" :title="$t('完成情况')" />
			</view>
			<!--上传进度框1-->
			<view
				v-if="status === '2' && user_type === 'join' && orderData.check_status === '2' && orderData.join_pay_status === '1'"
				class="step-form">
				<view class="step-item">
					<view>{{ $t('完成进度百分比，请上传1 - 100的整数，3天不传扣除1信誉分') }}：</view>
					<view>
						<u-input v-model="form.step" :placeholder="$t('请输入完成进度百分比')" />
					</view>
				</view>
				<view class="step-item">
					<view>{{ $t('完成进度文字说明') }}：</view>
					<view>
						<u-input v-model="form.title" :placeholder="$t('请输入完成进度文字说明，10个字以上')" />
					</view>
				</view>
				<view class="step-item">
					<view>{{ $t('进度完成图片') }}：</view>
					<view>
						<u-upload :upload-text="$t('选择图片')" @on-success="stepImgsSuccess" :action="releasePayImgAction"
							max-count="6"></u-upload>
					</view>
				</view>
				<view class="step-item" v-if="false">
					<view>{{ $t('进度完成时间') }}：</view>
					<view>
						<u-picker v-model="showFinishedTime" :params="finishedTimeParams" :show-time-tag="false"
							mode="time" @confirm="confirmFinishedtime" />
						<u-input v-model="finishedTimeText" disabled :placeholder="$t('请选择进度完成时间')"
							@click="showFinishedTime = true" />
					</view>
				</view>
			</view>
			<view class="publish_btn" v-if="status !== '0'">
				<!--  && lang === 'zh' -->
				<view v-if="['8','10'].indexOf(status) !== -1 && user_type === 'release'">
					<template v-if="refund_status !== 0">
						<u-button v-if="refund_status === 1" :custom-style="buttonStyle2" :hair-line="false"
							hover-class="none">
							{{ $t('售后中') }}
						</u-button>
						<u-button v-if="refund_status === 2" :custom-style="buttonStyle2" :hair-line="false"
							hover-class="none" @click="getRefundDetail">
							{{ $t('售后已完成') }}
						</u-button>
					</template>
					<template v-else>
						<u-button v-if="orderJoinData.is_margin=='2'" :custom-style="buttonStyle2" :hair-line="false"
							hover-class="none" @click="goAfterSale">
							{{ $t('申请售后') }}
						</u-button>
					</template>
				</view>
				<view v-if="joinListData.length > 0 || status !== '0'">
					<u-button :custom-style="buttonStyle1" :hair-line="false" hover-class="none" @click="communicates">
						{{ districts($t('即时沟通')) }}
					</u-button>
				</view>
				<view v-if="status === '0' && user_type === 'join'">
					<u-button :custom-style="buttonStyle1" :hair-line="false" hover-class="none" @click="communicates">
						{{ districts($t('即时沟通')) }}
					</u-button>
				</view>
				<view v-if="['0', '1'].indexOf(status) !== -1 && user_type === 'join'">
					<u-button :custom-style="buttonStyle2" :hair-line="false" hover-class="none" @click="stopJoin">
						{{ $t('终止参与') }}
					</u-button>
				</view>
				<view class="btn-box" v-if="joinListData.length > 0 || status !== '0'">
					<u-button class="my-btn" v-if="status === '0'" :custom-style="buttonStyle2" :hair-line="false"
						hover-class="none" @click="cooperate">
						{{ $t('选择合作') }}
					</u-button>
					<u-button class="my-btn" v-if="status === '1' && user_type === 'release'"
						:custom-style="buttonStyle1" :hair-line="false" hover-class="none" @click="stopJoin">
						{{ $t('终止参与') }}
					</u-button>
					<u-button class="my-btn" v-if="status === '2' && user_type === 'release' && orderData.step==100"
						:custom-style="buttonStyle2" :hair-line="false" hover-class="none" @click="orderConfirm">
						{{ $t('确认收货') }}
					</u-button>
					<!-- 发布方上传打款证明 -->
					<!--<u-button class="my-btn" v-if="status === '2' && user_type==='release'"-->
					<!--          :custom-style="buttonStyle2"-->
					<!--          :hair-line="false"-->
					<!--          hover-class="none"-->
					<!--          @click="uploadPayImage">-->
					<!--    {{ $t('上传打款证明') }}-->
					<!--</u-button>-->
					<u-button class="my-btn" v-if="status === '6' && user_type === 'release'"
						:custom-style="buttonStyle2" :hair-line="false" hover-class="none">
						{{ $t('已确认收货') }}
					</u-button>
					<u-button class="my-btn"
						v-if="status === '2' && user_type === 'join' && orderData.check_status === '2' && orderData.join_pay_status === '1'"
						:custom-style="buttonStyle2" :hair-line="false" hover-class="none" @click="sendStep">
						{{ $t('上传进度') }}
					</u-button>
					<u-button class="my-btn" v-if="status === '6' && user_type === 'join'" :custom-style="buttonStyle2"
						:hair-line="false" hover-class="none" @click="showJoin = true">
						{{ $t('对方已确认收货') }}
					</u-button>
					<u-button class="my-btn" v-if="['8', '10'].indexOf(status) !== -1" :custom-style="buttonStyle2"
						:hair-line="false" hover-class="none" @click="doEvaluate">
						<text v-if="orderData.release_rate_status === '1' && user_type === 'release'">
							{{ $t('已评价') }}
						</text>
						<text v-else-if="orderData.join_rate_status === '1' && user_type === 'join'">
							{{ $t('已评价') }}
						</text>
						<text v-else>{{ $t('立即评价') }}</text>
					</u-button>
					<!--不同意延期付款-->
					<u-button class="my-btn" v-if="['9'].indexOf(status) !== -1 && user_type === 'join'"
						:custom-style="buttonStyle2" :hair-line="false" hover-class="none" @click="showJoin = true">
						{{ $t('未付款') }}
					</u-button>
					<u-button class="my-btn" v-if="['9'].indexOf(status) !== -1 && user_type === 'release'"
						:custom-style="buttonStyle2" :hair-line="false" hover-class="none">
						{{ $t('对方未收到全款') }}
					</u-button>
				</view>
			</view>
		</view>
		<!--终止参与-->
		<u-modal v-model="show" :show-title="false" :content="content" :show-cancel-button="true"
			:cancel-text="$t('取消')" :confirm-text="$t('确认')" @cancel="stopCancel" @confirm="stopConfirm"></u-modal>
		<!--对方已确认收货弹窗-->
		<u-modal v-model="showJoin" :show-title="false" :content="contentJoin" :show-cancel-button="true"
			:cancel-text="$t('未收到')" :confirm-text="$t('已收到')" @cancel="joinCancel" @confirm="joinConfirm"></u-modal>
		<!--是否同意延期付款-->
		<u-modal v-model="showExtension" :show-title="false" :content="contentExtension" :show-cancel-button="true"
			:cancel-text="$t('不同意')" :confirm-text="$t('同意')" @cancel="extensionCancel"
			@confirm="extensionConfirm"></u-modal>
		<!--确认打款图片弹窗-->
		<u-modal v-model="showJoinPayImg" :show-title="false" :content="contentJoinPayImg" :show-cancel-button="true"
			:cancel-text="$t('取消')" :confirm-text="$t('确认')" @cancel="stopJoinPayImg"
			@confirm="saveJoinPayImg"></u-modal>
		<!--确认尾款图片弹窗-->
		<u-modal v-model="showJoinPayEndImg" :show-title="false" :content="contentJoinPayEndImg"
			:show-cancel-button="true" :cancel-text="$t('取消')" :confirm-text="$t('确认')" @cancel="stopJoinPayEndImg"
			@confirm="saveJoinPayEndImg"></u-modal>
		<payType v-if="showPayType" :show="showPayType" @close="closePayType" @change="changePayType" :off="off" />
		<view style="height: 160rpx;width: 100%;" v-if="status !== '0'"></view>
	</view>
</template>

<script>
	import {
		changeTextByPm
	} from '@/utils/index.js'
	import orderStep from "@/pages/order/components/orderStep/index.vue";
	import {
		exitCard,
		createC2CConversation,
		getOpenid,
		time
	} from "@/common/public";
	import {
		HTTP_REQUEST_URL,
		HTTP_IMG_UTL,
		IMAGE_URL
	} from "@/config/app";
	import buildForm from "@/components/buildForm/index.vue";
	import {
		formItems,
		getFormItems
	} from "../process/formItems"
	import {
		mapForm,
		mapFormItems,
		formRules
	} from '../buildFormItems.js'
	import payType from "@/components/payType.vue";
	import showDetail from "@/components/showDetail.vue";
	import myTitle from "@/components/myTitle.vue";

	import ItemGoods from "@/components/detail/GoodsItem2.vue";
	import ItemAgencyList from '@/components/detail/AgencyListItem.vue'
	import ItemTransportList from "@/components/detail/TransportListItem.vue";
	import ItemFreightForwarder from '@/components/detail/FreightForwarderItem.vue'
	import Tag from '@/components/Tag.vue'
	import TransportType from '@/components/TransportType.vue'

	export default {
		components: {
			myTitle,
			showDetail,
			payType,
			buildForm,
			orderStep,
			ItemGoods,
			ItemAgencyList,
			ItemTransportList,
			ItemFreightForwarder,
			Tag,
			TransportType
		},
		data() {
			return {
				HTTP_IMG_UTL,
				refund_status: undefined,
				template: {
					current: false, //是否被选中
					cardArr: [{
							key: "join_user.avatar",
							title: this.$t('头像'),
							isIcon: true,
							images: []
						},
						{
							key: "product",
							title: this.$t('名称'),
							message: ""
						},
						{
							key: "join_user.label",
							title: this.$t('标签'),
							isIcon: true,
							images: []
						},
						{
							key: "con_text",
							title: "合作内容",
							message: ""
						},
						{
							key: "price_ranking",
							title: "当前价格排名",
							message: ""
						},
						{
							key: "speed_ranking",
							title: "当前速度排名",
							message: ""
						},
						{
							key: "num_ranking",
							title: "当前综合排名",
							message: ""
						}
					]
				},
				templates: {
					current: false, //是否被选中
					cardArr: [{
							key: "join_user.avatar",
							title: this.$t('头像'),
							isIcon: true,
							images: []
						},
						{
							key: "product",
							title: this.$t('名称'),
							message: ""
						},
						{
							key: "join_user.label",
							title: this.$t('标签'),
							isIcon: true,
							images: []
						},
						{
							key: "con_text",
							title: "合作内容",
							message: ""
						},
						{
							key: "pay_margin",
							title: "是否缴纳保证金",
							message: ""
						},
						{
							key: "price_ranking",
							title: "当前价格排名",
							message: ""
						},
						{
							key: "speed_ranking",
							title: "当前速度排名",
							message: ""
						},
						{
							key: "num_ranking",
							title: "当前综合排名",
							message: ""
						}
					]
				},
				isStort: '',
				lang: this.$i18n.locale,
				url: IMAGE_URL,
				//价格
				value1: "",
				//速度
				value2: "",
				//综合排序
				value3: "",
				options1: [{
						label: this.$t('正序'),
						label_ru: this.$t('正序'),
						value: "ASC",
					},
					{
						label: this.$t('倒序'),
						label_ru: this.$t('倒序'),
						value: "DESC",
					}
				],
				//速度下拉菜单
				options2: [{
						label: this.$t('正序'),
						label_ru: this.$t('正序'),
						value: "ASC",
					},
					{
						label: this.$t('倒序'),
						label_ru: this.$t('倒序'),
						value: "DESC",
					},
				],
				//综合排序菜单
				options3: [{
						label: this.$t('正序'),
						label_ru: this.$t('正序'),
						value: "ASC",
					},
					{
						label: this.$t('倒序'),
						label_ru: this.$t('倒序'),
						value: "DESC",
					},
				],
				// 以上为合作列表新增的

				dataes: [],
				show: false,
				content: this.$t('是否终止参与？'),
				buttonStyle1: {
					// width: '171rpx',
					height: '49rpx',
					borderRadius: '14rpx',
					border: ' 2rpx solid #979797',
					fontSize: '29rpx',
					marginTop: '20rpx',
					fontWeight: '400',
					color: '#000000',
					lineHeight: '30rpx',
					marginRight: '20rpx'
				},
				buttonStyle2: {
					// width: '171rpx',
					height: 'auto',
					minHeight: '49rpx',
					fontSize: '29rpx',
					marginTop: '20rpx',
					fontWeight: '600',
					color: '#FFFFFF',
					lineHeight: '30rpx',
					border: '0rpx',
					background: 'linear-gradient(310deg, #F69528 0%, #DD2910 100%)',
					borderRadius: ' 14rpx',
					whiteSpace: 'normal'
				},
				id: 0,
				page: 1,
				joinList: [{
						key: "join_user.avatar",
						title: this.$t('头像'),
						isIcon: true,
						images: []
					},
					{
						key: "join_user.username",
						title: this.$t('名称'),
						message: ""
					},
					{
						key: "join_user.label",
						title: this.$t('标签'),
						isIcon: true,
						images: []
					},
					{
						key: "join_user.rating",
						title: this.$t("评分"),
						message: ""
					},
					{
						key: "con_text",
						title: this.$t("合作内容"),
						message: ""
					},
					{
						key: "pay_margin",
						title: this.$t("是否缴纳保证金"),
						message: ""
					},
					{
						key: "price_ranking",
						title: this.$t("当前价格排名"),
						message: ""
					},
					{
						key: "speed_ranking",
						title: this.$t("当前速度排名"),
						message: ""
					},
					{
						key: "num_ranking",
						title: this.$t("当前综合排名"),
						message: ""
					}
				],
				joinListData: [],
				orderInfo: [
					// {key: "show_text", title: this.$t("订单信息"), message: ""},
					// {key: "show_desire_price", title: this.$t('期望价格'), message: ""},
					// {key: "show_margin_price", title: this.$t('保证金金额'), message: ""},
					// {key: "show_goods_num", title: this.$t('数量'), message: ""},
					// {key: "show_reach_city.mergename", title: this.$t('收货地址'), message: ""},
					// {key: "show_pay_type.text", title: this.$t("付款方式"), message: ""},
					// {key: "show_desire_speed", title: this.$t('期望时间'), message: ""},
					// {key: "show_is_topping", title: this.$t('是否推广置顶'), message: ""},
					// {key: "order_no", title: this.$t('订单号'), message: ""},
				],
				orderJoin: [{
						key: "join_user.avatar",
						title: this.$t('头像'),
						isIcon: true,
						images: []
					},
					{
						key: "join_user.username",
						title: this.$t('名称'),
						message: ""
					},
					{
						key: "join_user.label",
						title: this.$t('标签'),
						isIcon: true,
						images: []
					},
					{
						key: "con_text",
						title: this.$t("合作内容"),
						message: ""
					},
					{
						key: "join_user.rating",
						title: this.$t("评分"),
						message: ""
					},
					{
						key: "margin_text",
						title: this.$t("保证金"),
						message: ""
					},
					{
						key: "price_ranking",
						title: this.$t("当前价格排名"),
						message: ""
					},
					{
						key: "speed_ranking",
						title: this.$t("当前速度排名"),
						message: ""
					},
					{
						key: "num_ranking",
						title: this.$t("当前综合排名"),
						message: ""
					}
				],
				orderJoinData: {},
				joinId: 0, // 参与订单id
				status: 0,
				options_status: 0,

				loading: false,
				isDetail2: 0,

				user_id: 0, // 当前用户id
				orderData: {},
				stepList: [],
				form: {
					step: '',
					title: '',
					finishedtime: ''
				},
				showFinishedTime: false,
				finishedTimeParams: {
					year: true,
					month: true,
					day: true,
					hour: true,
					minute: true,
					second: false,
					timestamp: true
				},
				finishedTimeText: "",
				showJoin: false,
				contentJoin: this.$t("对方已确认收货，是否收到全部货款或尾款？"),
				showExtension: false,
				contentExtension: this.$t("是否同意延期付款？"),
				user_type: "",
				to_mobile: "", // im目标用户手机号
				mobile: "", // 当前手机号
				countdownTime: 0,
				releasePayImgAction: HTTP_REQUEST_URL + '/common/upload',
				releasePayImgList: [],
				releasePayImgUrl: '',
				showJoinPayImg: false,
				showJoinPayEndImg: false,
				contentJoinPayImg: this.$t("是否确认打款？"),
				contentJoinPayEndImg: this.$t("是否确认打款？"),
				stepImgList: [],
				releasePayEndImgList: [],
				releasePayEndImgUrl: '',
				releasePayImgDeletable: true,
				releasePayEndImgDeletable: true,
				formItems: [],
				formJoinDetail: {},
				formLoading: false,
				formJoin: [],
				orderType: {
					'goods': '货物',
					'transport': '运输',
					'professional': '专业代办',
					'crossborder': '跨境货代',
				},
				releaseType: {
					1: '有车求货',
					2: '有货求车',
					3: '人力捎货',
					4: '货源信息',
					5: '我要带货',
				},
				showPayType: false,
				plat: '',
				pay_type: '',
				// lang: '',
				detailType: 'order_join',
				isDetail: false, //是否有提交按钮功能

				off: false,
				identity_type: ""
			};
		},
		async onLoad(options) {
			this.openid = await getOpenid(this.$u)

			this.id = options.id
			this.isDetail = options.isDetail || false
			this.orderCooperateLists({
				order_id: this.id,
				page: this.page
			})
			this.options_status = options.status // 0=已发布,1=已参与,2=进行中，3=已完成
			this.getOrderDetail()
			this.plat = uni.getStorageSync('plat')
			this.lang = uni.getStorageSync('lang')
			console.log("isDetail", this.isDetail)
			if (this.isDetail) {
				this.isDetail2 = 1
			}


			console.log(this.status)

			// if (this.isDetail === false) {
			// 	uni.setNavigationBarTitle({
			// 		title: this.$t("修改订单")
			// 	})
			// } else {
			// 	uni.setNavigationBarTitle({
			// 		title: this.$t("订单详情")
			// 	})
			// }
		},
		onReady() {
			uni.setNavigationBarTitle({
				title: this.$t("订单详情")
			})
		},
		onShow() {
			this.$u.api.user.appCheck().then(res => {
				this.off = res.logOff
			})
			let identity_type = uni.getStorageSync('userInfoFull');
			this.identity_type = identity_type.identity_type;
		},
		methods: {
			changeNumber(val) {
				/* 这里需要正则算法抓取数字替换 ，别喷我 */
				let str = '';
				switch (val) {
					case 'А1Имя':
						str = 'No1'
						break;
					case 'А2Имя':
						str = 'No2'
						break;
					case 'А3Имя':
						str = 'No3'
						break;
					case 'А4Имя':
						str = 'No4'
						break;
					case 'А5Имя':
						str = 'No5'
						break;
					case 'А6Имя':
						str = 'No6'
						break;
					case 'А7Имя':
						str = 'No7'
						break;
					case 'А8Имя':
						str = 'No8'
						break;
					case 'А9Имя':
						str = 'No9'
						break;
					case 'А10Имя':
						str = 'No10'
						break;
				}
				return str;
			},
			time,
			changeTextByPm,
			getRefundDetail() {
				this.$u.route({
					url: "/pages/order/afterSale/afterInfo",
					params: {
						order_id: this.id,
					}
				})
			},
			clear() {
				this.list = []
				this.page = 1
				this.template = {}
				this.template = JSON.parse(JSON.stringify(this.templates))
				this.value1 = ""
				this.value2 = ""
				this.value3 = ""
				this.type = ""
				this.isStort = ""
			},
			change(e, value) {
				this.clear()
				this.type = value
				this.isStort = e
				switch (value) {
					case "ranking_score":
						//综合
						this.value3 = e
						break
					case "price":
						//价钱
						this.value1 = e
						break;
					case "speed":
						//速度
						this.value2 = e
						break;
				}
				this.orderCooperateLists({
					order_id: this.id,
					page: this.page,
					sort: value,
					order: e
				})
			},
			// 列表接口
			orderCooperateLists(data) {
				this.$u.api.order.orderCooperateList(data).then(res => {
					console.log(res)
					this.dataes = res
					// this.list = []
					// console.log('list', this.list)
					// res.forEach(item => {
					//   this.template = JSON.parse(JSON.stringify(this.templates))
					//   this.template.cardArr = exitCard(this.template.cardArr, item)
					//   let temp = { current: false, cardArr: this.template.cardArr }
					//   this.list.push(temp)
					//   console.log(this.list)
					// })
					// uni.stopPullDownRefresh()
					// this.loading = true
				})
			},

			districts(val) {
				return val.length > 7 ? val.slice(0, 7) + "..." : val
			},
			communicates() {
				createC2CConversation(this.to_mobile, this)
			},
			communicates1(i) {
				let to_mobile = this.dataes[i].join_user.mobile
				createC2CConversation(to_mobile, this)
			},
			more(index) {
				//查看更多
				this.$u.route({
					url: "/pages/order/seeMore/seeMore",
					params: {
						order_id: this.id,
						index
					}
				})
			},
			getOrderDetail() {
				const that = this

				that.orderData = []
				that.joinListData = []
				that.releasePayImgList = []
				that.releasePayEndImgList = []


				// console.log('getOrderDetail', this.status)
				const nowTime = parseInt(new Date().getTime() / 1000)
				that.$u.api.order.getOrderDetail({
					id: that.id,
					status: that.options_status
				}).then(res => {
					//售后状态  refund_status 0=无售后 1=售后中 2=售后审核通过
					that.refund_status = res.refund_status;
					that.user_id = res.user_id
					that.mobile = res.mobile
					that.to_mobile = res.to_mobile
					if (res.user_id === res.orderInfo.release_user_id) { // 发布方
						that.user_type = 'release'
					} else if (res.user_id === res.orderInfo.join_user_id) { // 参与方（进行中）- 合作方
						that.user_type = 'join'
					} else {
						that.user_type = 'join_no' // 参与方，未达成合作
						// if (res.orderJoin.id) {
						//     if (res.user_id === res.orderJoin.join_user_id) {// 参与方，未达成合作
						//         that.user_type = 'join_no'
						//     }
						// }
						// that.$u.toast('订单信息错误')
						// return false
					}
					console.log('user_type========', this.user_type)



					that.orderData = res.orderInfo
					that.orderid = res.orderInfo.id
					that.status = res.orderInfo.status
					that.orderInfo = exitCard(that.orderInfo, res.orderInfo)

					if (res.orderJoin.margin_pay_notify_time) {
						that.pay_type = res.orderJoin.margin_pay_type
					}


					if (res.joinList.length > 0) {
						that.joinListData = res.joinList;
						// console.log('joinListData========', this.joinListData)
						that.joinList = exitCard(that.joinList, res.joinList[0])
						that.joinId = res.joinList[0].id
					}
					if (res.orderJoin.id) {
						// res.orderJoin.number_unit = res.orderInfo.release_info.number_unit
						that.orderJoinData = res.orderJoin

						// 新增-不同类型显示不同表单
						that.formItems = getFormItems(res.orderJoin.type, res.orderInfo.release_info, 0, 1)

						// that.formLoading = true
						let reach_time = res.orderJoin.reach_time
						let countdown_time = res.orderJoin.countdown_time

						// 倒计时时间 速度*天数 转换称秒数
						that.countdownTime = countdown_time - nowTime
						console.log('倒计时结束时间', that.countdownTime)
						that.orderJoin = exitCard(that.orderJoin, res.orderJoin)
						that.joinId = res.orderJoin.id


						// 参与方修改参与信息
						that.formJoinDetail = that.orderJoinData
						console.log(that.formItems)
						console.log(that.formJoinDetail)
						mapFormItems(that.formItems, that.formJoinDetail).then(mapRes => {
							that.formItems = mapRes
							
							for(var i=0;i<that.formItems.length;i++){
								if(that.formItems[i]['key']=='margin_amount'){
									that.formItems[i]['rule'] = {'edit':false}
								}
							}
							
							
							console.log(that.formItems)
						})

						mapForm(that.formItems, that.id).then(formRes => {
							that.formJoin = formRes
							that.formLoading = true
							console.log(that.formJoin);
						})


						that.formLoading = true
					}

					if (res.stepList.length > 0) {
						that.stepList = res.stepList
					}

					that.loading = true

					// 打款证明图片
					if (that.orderData.release_pay_status === '1') {
						that.releasePayImgDeletable = false
						that.releasePayImgList = [{
							url: IMAGE_URL + that.orderData.release_pay_img
						}]
					}
					// 尾款证明图片
					if (that.orderData.release_pay_end_status === '1') {
						that.releasePayEndImgDeletable = false
						that.releasePayEndImgList = [{
							url: IMAGE_URL + that.orderData.release_pay_end_img
						}]
					}

				}).catch(err => {
					console.log(err)
				})
			},
			// 选择合作
			cooperate() {
				this.$u.route({
					url: "/pages/order/process/cooperate",
					params: {
						order_id: this.id,
						join_order_id: this.joinId
					}
				})
			},
			cooperate1(i) {
				let join_order_id = this.dataes[i].id
				this.$u.route({
					url: "/pages/order/process/cooperate",
					params: {
						order_id: this.id,
						join_order_id: join_order_id
					}
				})
			},
			// 终止参与
			stopJoin() {
				this.show = true
			},
			stopCancel() {
				this.show = false
				this.$u.toast(this.$t('已取消'), 1000)
			},
			stopConfirm() {
				this.show = false
				const that = this
				that.$u.api.order.stopJoin({
					order_id: that.id,
					join_order_id: that.joinId
				}).then(res => {
					this.$u.toast(this.$t('终止参与成功'), 2000)
					setTimeout(() => {
						this.$u.route({
							url: '/pages/tabbar/order/index',
							type: 'switchTab'
						})
					}, 2000)
				}).catch(err => {
					console.log(err)
				})
			},
			// 确认收货
			orderConfirm() {
				const that = this
				that.$u.api.order.confirmReceipt({
					order_id: that.id,
					join_order_id: that.joinId
				}).then(res => {
					this.$u.toast(this.$t('确认收货成功'), 2000)
					setTimeout(() => {
						that.getOrderDetail()
					}, 1000)
				}).catch(err => {
					console.log(err)
				})
			},
			// 选择完成时间
			confirmFinishedtime(e) {
				this.form.finishedtime = e.timestamp
				this.finishedTimeText = e.year + '-' + e.month + '-' + e.day + ',' + e.hour + ':' + e.minute
			},
			// 上传进度
			sendStep() {
				const that = this
				let reg = new RegExp("^([1-9][0-9]{0,1}|100)$");
				let form = this.form
				if (!reg.test(form.step)) {
					that.$u.toast(this.$t('进度为1-100的整数'))
					return false
				}
				if (form.title.length < 10) {
					that.$u.toast(this.$t('说明需多于10个字符'))
					return false
				}
				form.finishedtime = parseInt(new Date().getTime() / 1000)
				if (form.finishedtime === '') {
					that.$u.toast(this.$t('请选择结束时间'))
					return false
				}
				if (that.stepImgList.length === 0 || !that.stepImgList[0].url) {
					that.$u.toast(this.$t('请上传图片'))
					return false
				}
				uni.showLoading({
					mask: true
				})
				that.$u.api.order.sendStep({
					order_id: that.id,
					order_join_id: that.joinId,
					step: form.step,
					title: form.title,
					finishedtime: form.finishedtime,
					images: that.stepImgList
				}).then(res => {
					setTimeout(() => {
						that.$u.toast(this.$t('进度上传成功'), 2000)

						// 清空进度上传输入框
						that.form.step = ''
						that.form.title = ''
						that.form.finishedtime = ''
						that.stepImgList = []
						that.getOrderDetail()
					}, 1000)

					setTimeout(function() {
						uni.hideLoading()
					}, 3000)
				}).catch(err => {
					console.log(err)
					uni.hideLoading()
				})
			},
			orderJoinConfirm(status) {
				const that = this
				that.$u.api.order.joinConfirm({
					order_id: that.id,
					join_order_id: that.joinId,
					status: status
				}).then(res => {
					this.$u.toast(this.$t('操作成功'), 2000)
					this.getOrderDetail()
					// setTimeout(() => {
					//     this.$u.route({
					//         url: '/pages/tabbar/order/index',
					//         type: 'switchTab'
					//     })
					// }, 2000)
				}).catch(err => {
					console.log(err)
				})
			},
			// 未收到
			joinCancel() {
				// 弹出是否同意延期提示框
				this.showExtension = true
			},
			// 已收到
			joinConfirm() {
				this.orderJoinConfirm('10')
			},
			// 不同意延期
			extensionCancel() {
				this.orderJoinConfirm('9')
			},
			// 同意延期
			extensionConfirm() {
				this.orderJoinConfirm('8')
			},
			// 提交售后
			goAfterSale() {
				this.$u.route({
					url: "/pages/order/afterSale/afterSale",
					params: {
						order_id: this.id
					}
				})
			},
			// 订单评价
			doEvaluate() {
				if (this.user_type === 'join') { // 我为参与方-评价发布方
					if (this.orderData.join_rate_status === '1') {
						this.$u.route({
							url: "/pages/order/evaluate/takepart",
							params: {
								type: "join",
								order_id: this.id
							}
						})
					} else {
						this.$u.route({
							url: "/pages/order/evaluation/evaluation",
							params: {
								type: "2",
								order_no: this.orderData.order_no,
								show_desire_price: this.orderData.show_desire_price,
								order_id: this.id
							}
						})
					}
				} else { // 我为发布方-评价参与方
					if (this.orderData.release_rate_status === '1') {
						this.$u.route({
							url: "/pages/order/evaluate/takepart",
							params: {
								type: "release",
								order_id: this.id
							}
						})
					} else {
						this.$u.route({
							url: "/pages/order/evaluation/evaluation",
							params: {
								type: "1",
								order_no: this.orderData.order_no,
								show_desire_price: this.orderData.show_desire_price,
								order_id: this.id
							}
						})
					}
				}
			},
			releasePayImgSuccess(data, index, lists, name) {
				let formData = [];
				if (lists.length > 0) {
					for (let i = 0; i < lists.length; i++) {
						if (lists[i].response) {
							let temp = {
								url: lists[i].response.data.url
							}
							formData.push(temp)
						} else if (lists[i].url) {
							let temp = {
								url: lists[i].url
							}
							formData.push(temp)
						}
					}
				} else {
					formData = []
				}
				this.releasePayImgUrl = formData[0].url
			},
			doSaveReleasePayImg() {
				if (this.releasePayImgUrl === '') {
					this.$u.toast(this.$t('上传打款证明图片'), 2000)
					return false
				}
				const that = this
				that.$u.api.order.saveReleasePayImg({
					order_id: that.id,
					user_id: that.user_id,
					release_pay_img: that.releasePayImgUrl
				}).then(res => {
					this.$u.toast(this.$t('操作成功'), 2000)
				}).catch(err => {
					console.log(err)
				})
			},
			doSaveJoinPayImg() {
				this.showJoinPayImg = true
			},
			doSaveJoinPayEndImg() {
				this.showJoinPayEndImg = true
			},
			stopJoinPayImg() {
				this.showJoinPayImg = false
				this.$u.toast(this.$t('已取消'), 1000)
			},
			stopJoinPayEndImg() {
				this.showJoinPayEndImg = false
				this.$u.toast(this.$t('已取消'), 1000)
			},
			saveJoinPayImg() {
				const that = this
				that.$u.api.order.saveJoinPayImg({
					order_id: that.id,
					user_id: that.user_id,
				}).then(res => {
					this.$u.toast(this.$t('操作成功'), 2000)
					this.getOrderDetail()
				}).catch(err => {
					console.log(err)
				})
			},
			saveJoinPayEndImg() {
				const that = this
				that.$u.api.order.saveJoinPayEndImg({
					order_id: that.id,
					user_id: that.user_id,
				}).then(res => {
					this.$u.toast(this.$t('操作成功'), 2000)
					this.getOrderDetail()
				}).catch(err => {
					console.log(err)
				})
			},
			stepImgsSuccess(data, index, lists, name) {
				let formData = [];
				if (lists.length > 0) {
					for (let i = 0; i < lists.length; i++) {
						if (lists[i].response) {
							let temp = {
								url: lists[i].response.data.url
							}
							formData.push(temp)
						} else if (lists[i].url) {
							let temp = {
								url: lists[i].url
							}
							formData.push(temp)
						}
					}
				} else {
					formData = []
				}
				console.log(formData)
				this.stepImgList = formData
			},
			releasePayEndImgSuccess(data, index, lists, name) {
				let formData = [];
				if (lists.length > 0) {
					for (let i = 0; i < lists.length; i++) {
						if (lists[i].response) {
							let temp = {
								url: lists[i].response.data.url
							}
							formData.push(temp)
						} else if (lists[i].url) {
							let temp = {
								url: lists[i].url
							}
							formData.push(temp)
						}
					}
				} else {
					formData = []
				}
				this.releasePayEndImgUrl = formData[0].url
			},
			doSaveReleasePayEndImg() {
				if (this.releasePayEndImgUrl === '') {
					this.$u.toast(this.$t('上传尾款证明图片'), 2000)
					return false
				}
				const that = this
				that.$u.api.order.saveReleasePayEndImg({
					order_id: that.id,
					user_id: that.user_id,
					release_pay_end_img: that.releasePayEndImgUrl
				}).then(res => {
					this.$u.toast(this.$t('操作成功'), 2000)
				}).catch(err => {
					console.log(err)
				})
			},
			// 参与方 - 提交修改参与的信息
			subForm() {
				console.log('subForm', this.formJoin)
				const that = this
				this.formJoin.release_id = this.orderJoinData.release_id
				this.formJoin.type = this.orderJoinData.type
				this.formJoin.openid = this.openid
				this.formJoin.speed_unit = this.orderJoinData.speed_unit
				this.formJoin.price_unit = this.orderJoinData.price_unit
				if (!formRules(that.formItems, that.formJoin, this)) {
					return false
				}
				if (that.formJoin.is_margin === '2') {
					if (that.formJoin.margin_amount * 1 === 0) {
						that.formJoin.is_margin = '1'
					}

					const lang = uni.getStorageSync('lang')
					if (lang === 'ru') {
						that.formJoin.is_margin = '1'
					}
				}


				if (that.off == false) {
					that.formJoin.is_margin = '1';
				}

				// 支付环境判断
				if (that.formJoin.is_margin === '2') {
					const lang = uni.getStorageSync('lang')
					if (lang === 'zh') {
						if (that.plat === 'web') {
							that.$u.toast(this.$t('请在小程序或App中支付'))
							return
						}
						if (that.pay_type === '') {
							that.showPayType = true
							return
						}
					} else {
						that.form.is_margin = '1'
					}
				}


				that.formJoin.pay_type = that.pay_type
				that.formJoin.method = that.plat

				if ((that.off == false) && (that.plat == 'app')) {
					that.formJoin.pay_type = 'alipay';
				}

				console.log(that.form)
				console.log(that.formJoin)

				if (that.formJoin.parameter) {
					that.formJoin.parameter = JSON.stringify(that.formJoin.parameter)
				}
				uni.showLoading({
					title: "Loading...",
					mask: true
				})
				that.$u.api.order.saveJoinOrder(that.formJoin).then(res => {
					uni.hideLoading();
					if (that.formJoin.is_margin === '2') {
						if (that.plat === 'mp-weixin') {
							if (res) {
								uni.requestPayment({
									provider: that.pay_type,
									method: that.plat,
									timeStamp: res.timeStamp,
									nonceStr: res.nonceStr,
									package: res.package,
									signType: res.signType,
									paySign: res.paySign,
									success: function(res) {
										console.log('success:' + JSON.stringify(res));
										that.$u.toast(that.$t('操作成功'))
										that.getOrderDetail()
									},
									fail: function(err) {
										console.log('fail:' + JSON.stringify(err));
										that.$u.toast("cancel")
									}
								});
							} else {
								that.$u.toast(that.$t('操作成功'))
								that.showPayType = false
								that.getOrderDetail()
							}
						} else if (that.plat === 'app') {
							if (res) {
								uni.requestPayment({
									provider: that.pay_type,
									orderInfo: res, // 微信-支付宝订单数据
									success: (res) => {
										console.log('success-score-order:' + JSON.stringify(res));
										that.$u.toast(that.$t('操作成功'))
										that.getOrderDetail()
									},
									fail: (err) => {
										console.log('fail:' + JSON.stringify(err));
										that.$u.toast("cancel")
									},
								});
							} else {
								that.$u.toast(that.$t('操作成功'))
								that.getOrderDetail()
							}

						}
					} else {
						that.$u.toast(that.$t('操作成功'))
						that.getOrderDetail()
					}
				}).catch(err => {
					console.log(err)
				})
			},
			formInput(val) {
				this.formJoin = val
			},
			goDetail() {
				this.$u.route({
					url: "/pages/index/detail/detail",
					params: {
						id: this.orderData.release_id,
						type: 2,
						releaseType: this.orderData.type,
						status: this.orderData.status
					}
				})
			},
			goHzDetail() {
				this.$u.route({
					url: "/pages/order/process/cooperate",
					params: {
						order_id: this.id,
						join_order_id: this.joinId,
						showBtn: 0
					}
				})
			},
			closePayType() {
				this.showPayType = false
			},
			changePayType(e) {
				this.pay_type = e
				this.subForm()
			},
			clickIcon(item) {
				if (item.explain) {
					let me = this;
					uni.showModal({
						title: me.$t("保证金"),
						content: me.$t("保证金释义"),
						showCancel: false,
						confirmText: this.$t("确定")
					})
				}
			}
		}
	}
</script>

<style lang="scss" scoped>
	.flex {
		display: flex;
	}

	.my-order-item {
		display: flex;

		.my-label {
			width: auto !important;
			overflow: hidden;
			white-space: normal;
			word-break: break-word;
			// text-align: right;
			font-weight: 600;
			font-size: 26rpx;
		}

		.my-text {
			width: auto !important;
			font-size: 26rpx;
		}
	}

	.slotBtns {
		display: flex;
		justify-content: flex-end;

		.viewBtn {
			margin: 0;
			padding: 0 20rpx;
			margin: 0 10rpx;
		}
	}

	.publish {
		margin-top: 19.19rpx;
		// height: 100vh;
		background-color: #F7F7F7;
		width: 100%;

		// padding-bottom: 100px;
		.publish_cooperation {
			display: flex;
			flex-direction: column;
			width: 100%;

			.publish_btn {
				width: 100%;
				position: fixed;
				bottom: 0;
				left: 0;
				z-index: 999;
				width: 100%;
				margin-top: -31rpx;
				border-top: 2rpx solid #E9E9E9;
				height: 108.14rpx;
				background-color: $my-bgColorFFFFFF;
				display: flex;
				padding: 10.91rpx;
				flex-direction: row-reverse;

				view {
					width: auto;
					height: 49rpx;
					margin-left: 10.91rpx;
				}
			}
		}

		.step-form {
			padding: 40rpx;
			background-color: $my-bgColorFFFFFF;
			margin-bottom: 100rpx;

			.step-item {
				border-bottom: 1px solid #efefef;
				margin-bottom: 10rpx;
			}
		}
	}

	.text {
		font-size: 27rpx;
	}

	.audit {
		width: 100%;
		padding: 20rpx 40rpx;
	}

	.countdown {
		text-align: center;
		width: 100%;
		padding: 0 40rpx 20rpx 40rpx;
		color: #fa3534;
		display: flex;
		align-items: center;
		justify-content: center;
	}

	.btn-box {
		display: flex;
		flex-direction: row-reverse;

		.my-btn {
			margin-right: 20rpx;
		}
	}

	.release-pay-img {
		background-color: #FFFFFF;
		padding: 40rpx;
		display: flex;
		align-items: center;

		.text {
			overflow: hidden;
			max-width: 260rpx;
		}
	}

	.viewBtn {
		min-width: 100rpx;
		max-width: 300rpx;
		margin-left: auto;
		height: 60rpx;
		color: #FFFFFF;
		text-align: center;
		line-height: 60rpx;
		border-radius: 20rpx;
		background: linear-gradient(310deg, #F69528 0%, #DD2910 100%);
	}

	.form-box {
		background-color: #fff;
		padding-bottom: 100rpx;
	}

	.form-title {
		padding: 30rpx;
		font-size: 16px;
		font-weight: 500;
	}

	.form-item {
		display: flex;
		flex-direction: column;
		padding-left: 40rpx;
		padding-right: 40rpx;
	}

	.form-item .item {
		display: flex;
		justify-content: space-between;
		line-height: 50rpx;
		font-weight: 600;

		&.red {
			color: #ff0000;
		}

		&.orange {
			color: #ff5400;
		}

		&.blue {
			color: #00a2ff;
		}
	}

	.my-order-box {
		background-color: #FFFFFF;
		padding: 20rpx 40rpx;

		.my-order-item1 {
			display: flex;
			justify-content: space-between;
			line-height: 40rpx;
			border-bottom: 1px solid rgb(228, 231, 237);
			padding: 15rpx 0;
		}

		.my-order-item {
			line-height: 40rpx;
			// border-bottom: 1px solid rgb(228, 231, 237);
			padding: 15rpx 0;

			.my-sign {
				width: 2rpx;
				margin-right: 10.47rpx;
				height: 37rpx;
				border: 5rpx solid;
				border-image: linear-gradient(180deg, rgba(221, 42, 16, 1), rgba(247, 152, 41, 1)) 5 5;
			}

			.my-title {
				font-weight: 500;
				font-size: 16px;
			}

			.my-text {
				overflow: hidden;
				white-space: normal;
				word-break: break-word;
				font-size: 32rpx;
				width: 100%;
				color: #aaa;
				// text-align: right;
			}

			.my-label {
				width: 100%;
				overflow: hidden;
				white-space: normal;
				word-break: break-word;
				// text-align: right;
				font-weight: 600;
				font-size: 26rpx;
			}
		}
	}


	// 列表样式
	.bidding_news {
		display: flex;
		justify-content: center;
		margin-bottom: 31.4rpx;

		.bidding_card {
			width: 692rpx;
			box-shadow: 0 0 10px #ddd;
			background: #ddd;
			padding: 10px;
			border-radius: 20rpx;
			position: relative;

			background: $my-bgColorFFFFFF;
			overflow: hidden;

			.bidding_user {
				display: flex;
				flex-direction: row;
				align-items: center;
				padding: $my-padding-20;

				// flex: 1;
				//头像大小
				.bidding_user_image {
					border: 1rpx solid orange;
					box-sizing: border-box;
				}

				//用户图标
				.bidding_user_icon {
					padding-left: $my-padding-10;
					height: 35rpx;
					width: 35rpx;
				}
			}

			//商品的简介
			.biddin_synopsis {
				display: flex;
				flex-direction: column;
				justify-content: flex-start;
				padding: 0 $my-padding-20 $my-padding-20 $my-padding-20;

				.bidding_synopsis_sel {
					font-size: 28rpx;
					color: #888888;
					// line-height: 50rpx;
					display: flex;

					&.line-height {
						line-height: 60rpx;
						align-items: center;

					}

					&.textLarge {
						font-size: 40rpx;
						padding: 15rpx 0;
					}

					&.font-weight {
						font-weight: 600;
						justify-content: space-between;
					}

					// border-bottom: 1rpx solid #eee;
					&.red {
						color: #ff0000;
					}

					&.orange {
						color: #ff5400;
					}

					&.blue {
						color: #00a2ff;
					}

					.text1 {
						font-weight: 400;
						color: #0B0B0B;
						padding-left: 10rpx;
						padding-right: 10rpx;

						&.font-weight {
							font-weight: 600;
						}

						&.red {
							color: #ff0000;
						}

						&.orange {
							color: #ff5400;
						}

						&.blue {
							color: #00a2ff;
						}
					}
				}
			}

			//商品图片展示区
			.bidding_image {
				position: absolute;
				bottom: 150rpx;
				right: 40rpx;

				image {
					width: 150rpx;
					height: 150rpx;
				}
			}

			//地址信息
			.bidding_address {
				padding: 13.6rpx $my-padding-20 10rpx $my-padding-20;
				display: flex;
				flex-direction: row;
				justify-content: space-between;
				font-size: $my-font-size21;
				font-weight: 400;
				color: #888888;
				line-height: 30rpx;

				.bidding_ares {
					flex: 1;
					display: flex;
					flex-direction: column;
					justify-content: flex-start;

					.bidding_ares1 {
						display: flex;
						justify-content: flex-start;

						image {
							width: 24.42rpx;
							height: 31.4rpx;
						}
					}
				}
			}
		}
	}

	.cooperation {
		width: 280rpx;
		// height: '49rpx',
		border-radius: 14rpx;
		border: 2rpx solid #979797;
		font-size: 29rpx;
		margin-top: 20rpx;
		font-weight: 400;
		color: #000000;
		line-height: 30rpx;
		padding: 10rpx 0 10rpx 0;
	}

	.communication {
		padding: 10rpx 0 10rpx 0;
		width: 280rpx;
		// height: '49rpx',
		font-size: 29rpx;
		margin-top: 20rpx;
		font-weight: 600;
		color: #FFFFFF;
		line-height: 30rpx;
		border: 0rpx;
		background: linear-gradient(310deg, #F69528 0%, #DD2910 100%);
		border-radius: 14rpx;
	}

	.panel {
		display: flex;
		text-align: center;
		justify-content: center;
		align-items: center;
	}
</style>